<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2023/4/29
  Time: 20:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--  前缀 c，核心包 --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>

<script type="text/javascript">
    function deleteUser(userId) {
        if (window.confirm("是否确定要删除编号为" + userId + "的这条记录呢？"))
            //页面控制台查看
            // console.log("确定要删除记录")
            location.href = "/userServlet?type=delete&id=" + userId;
    }
</script>


</head>


<body>


<div class="rightinfo">

    <div class="tools">

        <ul class="toolbar">
            <li>
                <a href="/user/userUpdate.jsp">
                    <span><img src="images/t01.png" /></span>添加
                </a>
            </li>

        </ul>
    </div>


    <table class="tablelist">
        <thead>
        <tr>
            <th>编号<i class="sort"><img src="images/px.gif" /></i></th>
            <th>账号</th>
            <th>密码</th>
            <th>手机号</th>
            <th>邮箱</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${requestScope.list}" var="user">
            <tr>
                <td>${user.id}</td>
                <td>${user.username}</td>
                <td>${user.password}</td>
                <td>${user.phoneNum}</td>
                <td>${user.email}</td>
                <td>
                    <a href="/userServlet?type=queryById&id=${user.id}" class="tablelink">修改</a>
                    <a href="JavaScript:deleteUser(${user.id})" class="tablelink">删除</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>

</div>


</body>
</html>